
package com.feib.soeasy.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.feib.soeasy.dao.PaymentCanceledReasonDao;
import com.feib.soeasy.dao.RealAccountDao;
import com.feib.soeasy.model.Group;
import com.feib.soeasy.model.PaymentCanceledReason;
import com.feib.soeasy.model.RealAccount;
import com.feib.soeasy.pagination.PaginatedList;
import com.feib.soeasy.service.PaymentCanceledReasonService;
import com.feib.soeasy.service.RealAccountService;


/**
 * @title (#)RealAccountServiceImpl.java<br>
 * @description <br>
 * @author Jimmy Liu<br>
 * @version 1.0.0 2010/11/25
 * @copyright Far Eastern International Bank Copyright (c) 2010<br>
 * @2011/2/12 create by Jimmy Liu<br>
 */
@Service("paymentCanceledReasonService")
public class PaymentCanceledReasonServiceImpl extends BaseServiceImpl implements PaymentCanceledReasonService {

    @Resource(name="paymentCanceledReasonDao")
    private PaymentCanceledReasonDao paymentCanceledReasonDao;
  /* (non-Javadoc)
     * @see com.feib.soeasy.service.PaymentCanceledReasonService#deletePaymentCanceledReason(com.feib.soeasy.model.PaymentCanceledReason)
     */
    @Override
    public void deletePaymentCanceledReason(PaymentCanceledReason paymentCanceledReason) {
        paymentCanceledReasonDao.deleteById(paymentCanceledReason.getPaymentCanceledReasonPk());
    }

    /* (non-Javadoc)
     * @see com.feib.soeasy.service.PaymentCanceledReasonService#queryByRealAccount(com.feib.soeasy.model.PaymentCanceledReason)
     */
	@Override
	public PaginatedList<PaymentCanceledReason> queryByRealAccount(
			PaymentCanceledReason paymentCanceledReason, PaginatedList<PaymentCanceledReason> paginationConfig) {
		return paymentCanceledReasonDao.queryPaginationByPaymentCanceledReason(paymentCanceledReason, paginationConfig);
	}

	  /* (non-Javadoc)
     * @see com.feib.soeasy.service.PaymentCanceledReasonService#addPaymentCanceledReason(com.feib.soeasy.model.PaymentCanceledReason)
     */
	@Override
	public PaymentCanceledReason addPaymentCanceledReason(
			PaymentCanceledReason paymentCanceledReason) {
		return paymentCanceledReasonDao.save(paymentCanceledReason);
	}

		
	/* (non-Javadoc)
	 * @see com.feib.soeasy.service.PaymentCanceledReasonService#queryByPk(java.lang.Long)
	 */
	@Override
	public PaymentCanceledReason queryByPk(Long pk) {
	    return paymentCanceledReasonDao.findByPk(pk);
	}
	
	  /* (non-Javadoc)
	  * @see com.feib.soeasy.service.PaymentCanceledReasonService#save(com.feib.soeasy.model.RealAccount)
	  */
	 @Override
	 public PaymentCanceledReason save(PaymentCanceledReason paymentCanceledReason) {
	     return paymentCanceledReasonDao.save(paymentCanceledReason);
	 }

	/* (non-Javadoc)
	 * @see com.feib.soeasy.service.PaymentCanceledReasonService#queryAllReasonByPk(com.feib.soeasy.model.Group)
	 */	 
	@Override
	public List<PaymentCanceledReason> queryAllReasonByGroupPk(Long groupPk) {
		return paymentCanceledReasonDao.findAllReasonByGroupPk(groupPk);
	}
	 
	/* (non-Javadoc)
	 * @see com.feib.soeasy.service.PaymentCanceledReasonService#queryByGroupPkAndCancelCode(java.lang.Long, java.lang.String)
	 */	 
	@Override
	public PaymentCanceledReason queryByGroupPkAndCancelCode(Long groupPk, String cancelCode) {
		return paymentCanceledReasonDao.findByGroupPkAndCancelCode(groupPk, cancelCode);
	}	
}
